<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/13-Promise.resolve-reject.js"></script>
</head>

<body>
    <script>
        // console.log(Promise.prototype);
        console.log('123',new Promise((resolve, reject)=>{

        }))
        
        let p = Promise.resolve(new Promise((resolve, reject)=>{
            // resolve('222')
            // reject('333');
            setTimeout(()=>{
                // resolve('ok');
                reject('error');
            },2000);
        }));
        console.log(p);


        let p2 = Promise.reject(new Promise((resolve,reject)=>{
            resolve('ok');
        }));
        console.log('p2: ', p2);
    </script>
</body>
</html>